<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('处理告警')" />
</head>
<body class="white-bg">
	<div class="wrapper wrapper-content animated fadeInRight ibox-content">
		<form class="form-horizontal m" id="form-user-handle">
			<input name="ids" type="hidden" th:value="${ids}" />
			<div class="form-group">
				<label class="col-sm-3 control-label">常用处理留言：</label>
				<div class="col-sm-8" th:with="type=${@dict.getType('alarm_handle_message')}">
					<a class="btn btn-default btn-xs common-message" th:each="dict : ${type}" th:text="${dict.dictLabel}" onclick="speedyHandler(this)"></a>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label is-required">处理留言：</label>
				<div class="col-sm-8">
					<textarea class="form-control" type="text" id="artificialMessage" name="artificialMessage" placeholder="处理留言" required></textarea>
				</div>
			</div>
		</form>
	</div>
	<th:block th:include="include :: footer" />
	<script type="text/javascript">
		$("#form-user-handle").validate({
			rules:{
				artificialMessage:{
					required:true,
					minlength: 2,
					maxlength: 255
				},
			},
			focusCleanup: true
		});

		function submitHandler() {
	        if ($.validate.form()) {
	        	$.operate.save(ctx + "system/alarm/handle", $('#form-user-handle').serialize());
	        }
	    }

		function speedyHandler(a) {
			let artificialMessage = $(a).text();
			$("#artificialMessage").val(artificialMessage);
		}

	</script>
</body>

</html>
